using System;
using System.Globalization;

namespace Prometheus.Binding.ReadOnly.BaseConverters
{
// ReSharper disable InconsistentNaming
    public class proX1IfTrue_X2IfFalseConverter : proChainConverter
// ReSharper restore InconsistentNaming
    {
        public object X1 { get; set; }
        public object X2 { get; set; }

        public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if ((bool) value) return X1;
            return X2;
        }

        public override object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == X1) return true;
            if (value == X2) return false;
            return null;
        }
    }
}